package com.sptpc.springbootmybatis.controller;

import com.sptpc.springbootmybatis.service.OrderService;
import com.sptpc.springbootmybatis.util.ServerResponse;
import com.sptpc.springbootmybatis.vo.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping(value = "/",params = {"page_num","page_size"})
    @ResponseBody
    public ServerResponse list(int page_num, int page_size){
        return ServerResponse.createBySuccess(orderService.findAllByPage(page_num, page_size));
    }

}
